Option Strict Off
Option Explicit On
Module ChangeFrameRate
	'This module changes the framerate of an avi file
	
	
	Public Function ChangeAviFrameRate(ByRef FileNameA As String, ByRef FrameRateA As Integer) As Boolean
		ChangeAviFrameRate = False 'Set function to initially return an error
		'UPGRADE_WARNING: Dir has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
		If Dir(FileNameA) = "" Then Exit Function 'If the file doesnt exist, exit the function
		On Error Resume Next 'Try to continue if an error occurs
		FileOpen(5, FileNameA, OpenMode.Binary) 'Open The destination File
		'UPGRADE_WARNING: Put was upgraded to FilePut and has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
		FilePut(5, CInt(1000000 / FrameRateA), 32 + 1) 'Frames per second shows microseconds per frame eg. hex 0007a120 = decimal 500000 ie 2 frames per second
		'UPGRADE_WARNING: Put was upgraded to FilePut and has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
		FilePut(5, CInt(1000000 / FrameRateA), 128 + 1) 'dwScale
		FileClose(5)
		If Err.Number <> 0 Then Exit Function 'An error has been generated during file writing so exit the function early.
		
		ChangeAviFrameRate = True 'Set function to return that it is OK
		
	End Function
End Module